]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Allow moving a window above the top workspace
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 15 Jan 2015 23:13:58 +0000 (00:13 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 16 Jan 2015 18:28:57 +0000 (19:28 +0100)
When using dynamic workspaces, a new workspace will be appended
when moving a window down to the last (empty) workspace. It makes
sense to extend the behavior in the opposite direction, and prepend
a new workspace when moving a window up from the first workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=665764

js/ui/windowManager.js

index 88acd459236a19002be390e0cb9ddca777ef6206..2f2a0de38ac7eab0adbd34135a55947a831488cf 100644 (file)
@@ -1527,6 +1527,11 @@ const WindowManager = new Lang.Class({
             direction = Meta.MotionDirection.DOWN;
             newWs = screen.get_workspace_by_index(screen.n_workspaces - 1);
         } else if (isNaN(target)) {
+            // Prepend a new workspace dynamically
+            if (screen.get_active_workspace_index() == 0 &&
+                action == 'move' && target == 'up')
+                this.insertWorkspace(0);
+
             direction = Meta.MotionDirection[target.toUpperCase()];
             newWs = screen.get_active_workspace().get_neighbor(direction);
         } else if (target > 0) {